package neu.soft.controller;

import neu.soft.entity.FinancialVoucher;
import neu.soft.query.FinancialVoucherQuery;
import neu.soft.service.FinancialService;
import neu.soft.service.FinancialVoucherService;
import neu.soft.vo.PageBean;
import neu.soft.vo.ResultBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 李博
 * 财务凭证服务接口
 */
@RestController
@RequestMapping("/voucher")
@CrossOrigin
public class FinancialVoucherController {

    @Autowired
    FinancialVoucherService financialVoucherService;

    //分页查询财务凭证
    @PostMapping
    public ResultBean<PageBean<FinancialVoucher>> findByPage(@RequestBody FinancialVoucherQuery financialVoucherQuery) {

        System.out.println(financialVoucherQuery.getVoucherId());
        PageBean<FinancialVoucher> pageBean = financialVoucherService.findByPage(financialVoucherQuery);
        return ResultBean.success(pageBean);
    }

}
